package com.carrental.integration.client;

import com.carrental.integration.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 短信服务的Feign客户端接口
 * 用于调用阿里云短信服务API
 */
@FeignClient(name = "aliyun-sms", url = "https://dysmsapi.aliyuncs.com", configuration = FeignConfig.class)
public interface SmsClient {

    /**
     * 发送短信
     *
     * @param accessKeyId 访问密钥ID
     * @param signature 签名结果串
     * @param timestamp 时间戳
     * @param format 返回数据的格式
     * @param signatureMethod 签名方式
     * @param signatureVersion 签名算法版本
     * @param signatureNonce 唯一随机数
     * @param version API版本号
     * @param action API的命名
     * @param regionId 区域ID
     * @param phoneNumbers 手机号码
     * @param signName 短信签名
     * @param templateCode 短信模板CODE
     * @param templateParam 短信模板变量对应的实际值
     * @return 发送结果
     */
    @PostMapping("/")
    String sendSms(@RequestParam("AccessKeyId") String accessKeyId,
                   @RequestParam("Signature") String signature,
                   @RequestParam("Timestamp") String timestamp,
                   @RequestParam("Format") String format,
                   @RequestParam("SignatureMethod") String signatureMethod,
                   @RequestParam("SignatureVersion") String signatureVersion,
                   @RequestParam("SignatureNonce") String signatureNonce,
                   @RequestParam("Version") String version,
                   @RequestParam("Action") String action,
                   @RequestParam("RegionId") String regionId,
                   @RequestParam("PhoneNumbers") String phoneNumbers,
                   @RequestParam("SignName") String signName,
                   @RequestParam("TemplateCode") String templateCode,
                   @RequestParam("TemplateParam") String templateParam);
} 